import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({ //实例化出来一个仓库
	state: { //对比着我们之前对vue实例化的data数据
		curSong: "",
		songtitle: "",
		songautro: "",
		songpic: "",
		songPicBig: "",
		songids:"",
		sontlieng:"",
		song:"",
		songList:[],
		shijian:"",
		tinuId:"",
		curType:"",
		lrcY:"",
	},
	mutations: { //对比着vue实例的methods
		//我们不能直接改变state里面数值，一定要通过提交(commit)mutation来实现改变state的值
		changeLrc(a,b){
			a.lrcY = b;
		},
		changeSong(s, p) { //接收一个参数为state数据
			s.curSong = p;
		},
		changeSongname(a, b) { //接收一个参数为state数据
			a.songtitle = b;
		},
		changeSongautro(a, b) { //接收一个参数为state数据
			a.songautro = b;
		},
		changeSongpic(a, b) { //接收一个参数为state数据
			a.songpic = b;
		},
		changeSongpicbig(a, b) { //接收一个参数为state数据
			a.songPicBig = b;
		},
		changeSongids(a, b) { //接收一个参数为state数据
			a.songids = b;
		},
		changeSonglileng(a, b) { //接收一个参数为state数据
			a.sontlieng = b;
		},
		changessong(a, b) { //接收一个参数为state数据
			a.song = b;
		},
		setSongList(s,p){
			s.songList = p;
		},
		changeSongsj(a,b){
			a.shijian=b;
		},
		singerId(s,p){
			s.tinuId = p;
		},
		//type值
		changeCurType(s,p){
			s.curType = p;
		}
	}
})